import BasePage from '@/pages/basePage.js'

// 增改查弹框公共属性方法类
export default class BaseDialog extends BasePage {
  constructor () {
    super()
    return {
      props: {
        visible: {
          type: [Boolean]
        },
        editModel: {
          type: [String],
          default: function () {
            return ''
          }
        },
        form: {
          type: Object,
          default: function () {
            return {}
          }
        },
        api: {
          type: Object,
          default: function () {
            return {}
          }
        }
      },
      computed: {
        dialogVisible: {
          get: function () {
            return this.visible
          },
          set: function (value) {
            this.$emit('update:visible', value)
          }
        }
      },
      data () {
        return {
        }
      },
      methods: {
        // 弹框保存后查询
        onSave () {
          this.$emit('handSearch')
        }
      }
    }
  }
}
